package org.example.springbootproject.service.impl;

import org.example.springbootproject.pojo.Warehousing;
import org.example.springbootproject.mapper.WarehousingMapper;
import org.example.springbootproject.service.WarehousingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.time.LocalDate;
import java.util.List;


@Service
public class WarehousingServiceimpl implements WarehousingService {

    @Autowired
    private WarehousingMapper warehousingMapper;

    @Override
    public List<Warehousing> findWarehousing() {
        return warehousingMapper.findWarehousing();
    }

    @Override
    public void upDateWarehousing(Warehousing warehousing) {
        LocalDate date = warehousing.getStorageTime();
        String string = warehousing.getLicensePlateNumber();
        Integer integer = warehousing.getInboundQty();
        Double dou = warehousing.getInboundTonnage();

        warehousingMapper.addGoods(warehousing.getStorageTime(),warehousing.getInboundTonnage());
        warehousingMapper.upDateWarehousing(date,string,integer,dou);
    }
}
